const express=require("express");
const app=express();
const bodyParser=require("body-parser");
app.listen(8080);
const userRouter=require("./router/user.js");
const merchandiseRouter=require("./router/merchandise");
app.use(bodyParser.urlencoded({extended:false}));
app.use("/v1/users",userRouter);
app.use("/v1/merchandise",merchandiseRouter);
app.use((err,req,res,next)=>{
    console.log(err);
    res.send({code:500,msg:"服务器端错误"});
})
app.use(express.static("./public"));